package com.liu.producer.message;


import com.liu.generator.Generator;
import com.liu.serialization.SerializationTypeEnum;

/**
 * @param
 * @BelongsProject: QueueDemo2
 * @BelongsPackage: com.liu.producer.message
 * @author: L
 * @Date: 2023/10/16 16:00
 * @return
 */

public class Message {

    protected Long messageID;
    protected String topic;
    protected SerializationTypeEnum serializationType;
    protected Object body;

    public Long getMessageID() {
        return messageID;
    }

    public void setMessageID(Generator generator) {
        this.messageID = generator.generateMessageID();
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public SerializationTypeEnum getSerializationType() {
        return serializationType;
    }

    public void setSerializationType(SerializationTypeEnum serializationType) {
        this.serializationType = serializationType;
    }

    public Object getBody() {
        return body;
    }

    public void setBody(Object body) {
        this.body = body;
    }

    public Message() {
    }

    public Message(Generator generator, String topic, SerializationTypeEnum serializationType, Object body) {
        this.messageID = generator.generateMessageID();
        this.topic = topic;
        this.serializationType = serializationType;
        this.body = body;
    }
}
